﻿{extend name="public:base" /}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <a href="{:url('doCar')}" class="btn btn-primary btn-lg">新增</a>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="iconfont icon-chevron-up"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                    <div class="hr-line-dashed"></div>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <tr>
                                <th>ID</th>
                                <th>图片</th>
                                <th>车型</th>
                                <th>车牌</th>
                                <th>日租金</th>
                                <th>司机</th>
                                <th>累计创收</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td><img src="{$vo.img}" style="width: 100px;height: 100px; object-fit: cover" /></td>
                                <td>{$vo.model}</td>
                                <td>{$vo.number}</td>
                                <td>{$vo.price}</td>
                                <td>{$vo.user_id|getUsername}</td>
                                <td>{$vo.all_profit}</td>
                                <td>{$vo.is_upper == 1 ? '已上架' : '已下架'}</td>
                                <td>
                                    <a href="{:url(doCar, ['id' => $vo.id])}" class="btn btn-white btn-sm"><i class="iconfont icon-edit"></i> 编辑 </a>
                                    {if $vo.user_id == 0}
                                    {if $vo.is_upper == 1}
                                    <a href="{:url(upperCar, ['id' => $vo.id, 'is_upper' => -1])}" class="btn btn-white btn-sm ajax-operate"><i class="iconfont icon-change"></i> 下架 </a>
                                    {else /}
                                    <a href="{:url(upperCar, ['id' => $vo.id, 'is_upper' => 1])}" class="btn btn-white btn-sm ajax-operate"><i class="iconfont icon-change"></i> 上架 </a>
                                    {/if}
                                    <a href="{:url(delCar, ['id' => $vo.id])}" class="btn btn-white btn-sm ajax-del"><i class="iconfont icon-trash"></i> 删除 </a>
                                    {/if}
                                </td>
                            </tr>
                            {/volist}
                        </table>
                        {if !empty($list)}{$list->render()}{/if}
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
{/block}
